package com.uni.crawl.model.entity.crawl;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.uni.crawl.common.base.UserBaseEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;

import java.time.LocalDateTime;

/**
 * <p>
 * 爬虫模板
 * </p>
 *
 * @author JervisPG
 * @since 2023-12-16
 */
@Getter
@Setter
@TableName("crawl_template")
@ApiModel(value = "CrawlTemplate对象", description = "爬虫模板")
public class CrawlTemplate extends UserBaseEntity {

    @ApiModelProperty("ID")
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    @ApiModelProperty("模板编码")
    private String tmplCode;

    @ApiModelProperty("模板名称")
    private String tmplName;

    @ApiModelProperty("空间编码")
    private String nsCode;

    @ApiModelProperty("种子URL")
    private String seedUrl;

    @ApiModelProperty("定时任务小时数. 爬虫按小时就够了")
    private Integer schedHour;

    @ApiModelProperty("可翻页的任务.true-是；false-否")
    private Boolean pageable;

    @ApiModelProperty("分页抓取限制")
    private Integer pagingLimit;

    @ApiModelProperty(value = "分页选择器解析模板")
    private String pagingSelectorTmpl;

    @ApiModelProperty(value = "分页列表解析模板", notes = "数据列表")
    private String pagingListTmpl;

    @ApiModelProperty("页面提取信息的模板")
    private String pageDetailTmpl;

    @ApiModelProperty("任务优先级.值越小优先级越高")
    private Integer schedPriority;

    @ApiModelProperty("模板状态。0-关闭，1-开启")
    private Integer tmplStatus;

    @ApiModelProperty("审批状态。0-未审批；1-审批中；2-审批通过")
    private Integer approveStatus;

    @ApiModelProperty("备注")
    private String remark;

    @ApiModelProperty("上次执行时间")
    private LocalDateTime lastRunTime;

    @ApiModelProperty("是否删除：true-是；false-否")
    private Boolean isDeleted;
}
